package com.mc.mcgoweb.utils.xml2bean;

import org.junit.Test;

public class Xmltest {

    /**
     * <?xml version="1.0" encoding="utf-8"?>
     * <request>
     *   <deliveryOrder> .....</deliveryOrder>
     * @param args
     */
    public static void main(String[] args) {
        OrderDetail detail=new OrderDetail();
        detail.setOperator("");
        detail.setFreightdisplaycode("");
        detail.setSaleID("");
        detail.setSerialno("");
        detail.setSaleDate("");
        detail.setUno("");
        detail.setUnit("");
        detail.setAddress("");
        detail.setSend_by("");
        detail.setSend_method("");
        detail.setContact("");
        detail.setTel("");
        detail.setStation("");
        detail.setFax("");
        detail.setPostcode("");
        detail.setSmoney("");
        detail.setTown("");
        detail.setCity("");
        detail.setProvince("");
        detail.setAmount("");
        detail.setRemark("");
        detail.setId("");
        String s = XmlUtils.beanToXml(detail);
        StringBuffer s1=new StringBuffer();
        s1.append(s);
        //在字符串头部插入
        s1.insert(0,"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n");
        System.out.println(s1);

    }

    @Test
    public void testjiami(){
        String str="<request><deliveryOrder><totalOrderLines>2</totalOrderLines><deliveryOrderCode>WM2019042500000010</deliveryOrderCode><deliveryOrderId>D1904280000004</deliveryOrderId><warehouseCode>郑州仓</warehouseCode><orderType>B2BCK</orderType><status>DELIVERED</status><outBizCode>OB1904280000002</outBizCode><logisticsCode>YMDDWL</logisticsCode><logisticsName>壹米滴答物流</logisticsName><expressCode>123321</expressCode><orderConfirmTime>2019-04-28 11:11:47</orderConfirmTime><ownerCode>1110</ownerCode></deliveryOrder><packages><package><logisticsName>壹米滴答物流</logisticsName><expressCode>123321</expressCode><packageCode>123321</packageCode><weight>88.0</weight><volume>0.591778</volume><packageMaterialList><packageMaterial><quantity>1</quantity></packageMaterial></packageMaterialList><items><item><itemCode>11102026000133</itemCode><itemId>ST1904260000003</itemId><quantity>2</quantity></item><item><itemCode>11101210000274</itemCode><itemId>ST1904260000002</itemId><quantity>20</quantity></item></items></package></packages><orderLines><orderLine><orderLineNo>231</orderLineNo><itemCode>11102026000133</itemCode><itemId>ST1904260000003</itemId><itemName>R26W/BpL(A3)成品01W</itemName><inventoryType>ZP</inventoryType><actualQty>2</actualQty><batchs/><sns><sn>123456789123456789</sn><sn>123456789123456788</sn></sns></orderLine><orderLine><orderLineNo>231</orderLineNo><itemCode>11101210000274</itemCode><itemId>ST1904260000002</itemId><itemName>R26G/BpLF700(A3)成品01G</itemName><inventoryType>ZP</inventoryType><actualQty>10</actualQty><batchs/><sns><sn>123456789123456787</sn><sn>123456789123456786</sn></sns></orderLine></orderLines></request>";
        try {
            Integer a=1;
            System.out.println(a.equals(null));
             WmsLink.sendToWms(WmsConstant.STOCKOUT_CONFIRM, str);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

}
